package uy.com.tsi2G7.superbet.bet;

import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.IndexColumn;

@Entity
@DiscriminatorValue("COMPOSITE")
public class CompositeBet extends Bet {

	@ManyToMany(cascade = {CascadeType.ALL})
	@JoinTable(
        name="BETS_COMP",
        joinColumns=@JoinColumn(name="COMP_BET_ID"),
        inverseJoinColumns=@JoinColumn(name="BET_ID")
    )
    @IndexColumn(name = "INDEX_", base=1)
	private SimpleBet[] bets;

	public SimpleBet[] getBets() {
		return bets;
	}

	public void setBets(SimpleBet[] bets) {
		this.bets = bets;
	}
	
	
}
